import cv2
import numpy as np
from matplotlib import pyplot as plt
import random,time
from PIL import ImageGrab
import pyautogui
import cv2
import numpy as np
import time
from 子函数 import yinru
from 子函数.yinru import cs,zd ,yqfy,jr ,zb ,js ,sb ,yh ,ts ,bqds ,zd1 ,cjdw ,cj ,kszd ,qd ,jjtp ,jg ,yq ,di2zhang,di3zhang ,di4zhang ,di5zhang
from 子函数.yinru import di20zhang ,di21zhang ,di22zhang ,di23zhang ,ts1 ,daotubiao ,daotubiao1 ,zhanliping ,huodejiangli ,zaizhanchang ,haifangzhu ,sx ,tz ,xiaomao
from 子函数.yinru import jiejietupo ,liuxunzhang,jieshu,danjujieshu,qr1,时间下限,时间上限,feiliuxing,jieshou
from 子函数.yinru import chahao ,shoudong,doujijieshu,meijuanle,yinlangniaomeikai
def 阴阳寮没开():
    # 阴阳寮没开
    img_rgb = np.array(ImageGrab.grab().convert('RGB'))#屏幕截图
    img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
     # 阴阳寮没开
    res = cv2.matchTemplate(img_gray, yinlangniaomeikai, cv2.TM_CCOEFF_NORMED)  # 大图 ，目标 ，模式
    threshold = 0.95  # 阈值 图片相识度
    loc = np.where(res >= threshold)
    for pt in zip(*loc[::-1]):
        # cv2.rectangle(img_rgb, pt, (pt[0] + w, pt[1] + h), (0, 0, 255), )#在图片选中位置画线框
        # pyautogui.moveTo(int(pt[0])+10, int(pt[1])+10)  # 鼠标移动到坐标位置
        # pyautogui.click()  # 鼠标点击
        print("阴阳寮没开")
        # time.sleep(600)

        zhuangtai = 1
        return zhuangtai

